#ifndef CDISPLAY_H
#define CDISPLAY_H

#include "myqglwidget.h"
#include "QtOpenGL"
#include "qdebug.h"
#include "cdrawable.h"
#include "ccamera.h"
#include "QVector"

class CDisplay : public myQGLWidget
{
    Q_OBJECT
public:
    explicit CDisplay(QWidget *parent = 0);
    void initializeGL();
    void resizeGL(int width, int height);
    void paintGL();

    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void mouseDoubleClickEvent(QMouseEvent *event);
    void keyPressEvent(QKeyEvent * keyEvent);
    void enterEvent(QEvent * event);

    void set_render_mode(GLenum mode);
    void enable_lighting();
    void disable_lighting();

    void add_object(CDrawable* obj);

    QVector<CDrawable*> m_objects;
    CCamera * m_pCamera;

private:
    GLfloat m_fRotationX;
    GLfloat m_fRotationY;
    GLfloat m_fRotationZ;
    QPoint  m_LastPos;

    GLenum  m_RenderMode;
};

#endif // CDISPLAY_H
